package com.lzp.controller;


import com.lzp.entity.Student;
import com.lzp.service.StudentService;
import com.lzp.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/student")
public class StudentController {//控制器
    @Autowired
    private StudentService studentService;
    @GetMapping("/list")
    public R findAll(){
        List<Student> list=studentService.list();
        return R.ok().data("students",list);
    }
}


















